/**
 * Created by vicket on 2017/4/23.
 */
$(function(){
    var novelId=sessionStorage.getItem("bookId");
    var back=$(".back");
    back.attr("href","noveldetail.ejs#"+novelId);
    var chapterList=$(".chapter_list");
    var chapterSum=$(".chapter_sum span");
    $.ajax({
        type:"get",
        url:"/api/frontGetBookDetail",
        data:{bookId:novelId},
        success:function(result){
            sessionStorage.setItem("totalSection",result[0].totalSection);
            chapterSum.text(result[0].totalSection);
            var html=template("cataloglist",{items:result[0].chapters});
            chapterList.html(html);
        }
    })


});